package cn.zmwh.portal.modules.index.controller;


import cn.zmwh.common.core.api.Result;
import cn.zmwh.common.core.constants.Constants;
import cn.zmwh.common.security.service.factory.LoginServiceFactory;
import cn.zmwh.portal.modules.index.service.TlUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author dmzmwh
 * @since 2024-08-26
 */
@Api(tags = "用户相关")
@RestController
@RequestMapping
public class TlUserController {

    @Autowired
    LoginServiceFactory factory;
    @Autowired
    TlUserService tlUserService;

    @GetMapping("/api/user")
    @ApiOperation(value = "获取用户信息")
    public Result userInfo(@ApiIgnore @RequestHeader(Constants.UID) Long id) throws Exception {
        return tlUserService.userInfo(id);
    }

}

